package com.kgd.news.utils;

import com.jfinal.core.JFinal;
import com.jfinal.plugin.ehcache.CacheKit;

public class CacheUtils {
    public static final String CACHEUTILS = "cache_utils";
    public static void setCache(String key, String value) {
        CacheKit.put(CACHEUTILS,key,value);
    }
    public static String getCache(String key) {
       return CacheKit.get(CACHEUTILS, key);
    }
    public static void setContextCache(String key, String value) {
        JFinal.me().getServletContext().setAttribute(key,value);
    }
    public static String getContextCache(String key) {
        return (String)JFinal.me().getServletContext().getAttribute(key);
    }

//    全局变量
//            JFinal.me().getServletContext().getAttribute()

}
